#ifndef ACTOR_H_
#define ACTOR_H_

#include "stdafx.h"
#include "level_object.h"
#include "actor_desc.h"

#define ACTOR_DEFAULT_IDLE_ANIMATION_NAME		"Idle"
#define ACTOR_DEFAULT_WALK_ANIMATION_NAME		"Walk"

namespace rpg {

	class Actor : public LevelObject {
	public:
		Actor(const ActorDesc &actorDesc);
		~Actor(void);

		void clearWaypoint(void);
		void addPointToWaypoint(const Ogre::Vector3 &point);
		void addListToWaypoint(const std::list<Ogre::Vector3> *waypoint);	
		bool isWaypointEmpty(void) const;
		Ogre::Vector3 getCurrentMovePoint(void) const;
		void update(float deltaTime);
	private:
		Ogre::AnimationState *mIdleAnimation;
		Ogre::AnimationState *mWalkAnimation;
		Ogre::SceneNode *mActorNode;
		Ogre::Entity *mActorEntity;
		Ogre::Real mMaxMoveSpeed;
		std::list<Ogre::Vector3> mWaypoint;

		void safeEnableIdleAnimation(bool enable);
		void safeEnableWalkAnimation(bool enable);		
		void safeIdleAnimationAdvance(float deltaTime);
		void safeWalkAnimationAdvance(float deltaTime);
	};

}

#endif /* ACTOR_H_ */
